/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package server;

import java.util.Timer;
import java.util.TimerTask;

/**
 *
 * @author user
 */
public class TimeOut {

    Timer timer;

    public TimeOut(int interval) {
        timer = new Timer();
        timer.schedule(new Timeout(), interval*1000);
    }
    class Timeout extends TimerTask {

    @Override
    public void run() {
        System.out.println("timeout");
        timer.cancel();
    }
}

    public static void main(String[] args){
        new TimeOut(5);
    }
}

